-
Notifications
You must be signed in to change notification settings - Fork 295
feat: store envelopes as list of threads #11529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
5788190 to
0100ddb
Compare
lib/Db/MessageMapper.php
Outdated
| $res = $qb->executeQuery(); | ||
| while ($row = $res->fetch()) { | ||
| $message = $this->mapRowToEntity($row); | ||
| if ($message->getThreadRootId() === null) { | ||
| $results[] = [$message]; | ||
| } else { | ||
| $results[] = $this->findThread($account, $message->getThreadRootId(), $sortOrder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the n+1 can be avoided with a subquery or self join
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When called from getDatabaseSyncChanges I wonder if it's even necessary to fetch messages of the same thread. We already know the new IDs. Other messages are not relevant, are they?
lib/Db/MessageMapper.php
Outdated
| $res = $qb->executeQuery(); | ||
| while ($row = $res->fetch()) { | ||
| $message = $this->mapRowToEntity($row); | ||
| if ($message->getThreadRootId() === null) { | ||
| $results[] = [$message]; | ||
| } else { | ||
| $results[] = $this->findThread($account, $message->getThreadRootId(), $sortOrder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
6e22993 to
d2f326b
Compare
|
src/store/mainStore/actions.js
Outdated
| const threadEnvelopes = this.threads[threadRootId] | ||
| const threadIdx = threadEnvelopes.indexOf(id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- BUG:
[ERROR] mail: Background sync failed: threadEnvelopes.indexOf is not a function
| view: this.getPreference('layout-message-view'), | ||
| })), | ||
| Promise.all.bind(Promise), | ||
| andThen(map(sliceToPage)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sliceToPage made sure that you always get 20 items, no matter how many mailboxes are combined.
I yet have to test it but I think without the slicing you will get 20 x number of accounts items back now.
Signed-off-by: Hamza <[email protected]>
Signed-off-by: Hamza <[email protected]>
Signed-off-by: Hamza <[email protected]>
Signed-off-by: Hamza <[email protected]>
Signed-off-by: Hamza <[email protected]>
fac228d to
ee4ce1f
Compare
|
Removed the merge and rebased instead + conflicts resolution for smoother squashing later, Pushing the fixes in a bit |
Signed-off-by: Hamza <[email protected]>







Ref #11065 (comment)